/****************************************************************************/      
/* NAME:           Hal_InputManagement.h                                    */      
/* PURPOSE:        Manage all basic input and output                        */      
/* CREATED_BY:     Vyx                                                      */      
/* CREATION_DATE:  03/07/2012                                               */   
/************************************** (C) Copyright 2012 AquaLink *********/   

#ifndef INPUT_MANAGEMENT_DEF
#define INPUT_MANAGEMENT_DEF

#include "Hal_GenericConfig.h"
#include "stm32f10x.h"
#include "stm32_config.h"
#include "main.h"

/* to choose the config pin input */
#ifdef STM32_CONFIG_1 /* STM32_CONFIG_1 */

/* Add your input in this table */
#define OSMOLATOR_SENSOR_LOW       0
#define OSMOLATOR_SENSOR_HIGH      1
#define OSMOLATOR_SENSOR_RESERVE   2
#define OSMOLATOR_MANUAL_START     3
#define USART_1_TX                 4

#endif /* STM32_CONFIG_1 */

#ifdef STM32_CONFIG_2 /* STM32_CONFIG_2 */

/* Add your input in this table */
#define OSMOLATOR_SENSOR_LOW       0
#define OSMOLATOR_SENSOR_HIGH      1
#define OSMOLATOR_SENSOR_RESERVE   2
#define OSMOLATOR_MANUAL_START     3
#define USART_1_TX                 4

#endif /* STM32_CONFIG_2 */
                

typedef struct
{
  GPIO_TypeDef    *InputGpio;
  uint16_t         InputPin;
  GPIOMode_TypeDef InputMode;
}Input_def_t;

/**    
  * @brief  Main function of input management.  
  *         This function is execute one time at the start.
  * @param  none    
  * @retval None    
  */  
void vTaskCTRL_InputManagementInit();

/**    
  * @brief  Service to get filtered input  
  * @param  none    
  * @retval None    
  */ 
void vTaskGET_InputFilteredManagement();

/**    
  * @brief  Get the value of selected input.    
  * @param  Name of input 
  * @retval Value of input (TRUE or FALSE)
  */  
bool INPUT_GetInputValue(uint8_t InputName);

/**    
  * @brief  Get the value of filtered selected input.    
  * @param  Name of input 
  * @retval Value of input (TRUE or FALSE)
  */  
bool INPUT_GetFilteredInputValue(uint8_t InputName);

#endif /* INPUT_MANAGEMENT_DEF */
